import React from 'react';
import template from './../commonui/template';
import { Link } from 'react-router-dom';
// import 'antd/dist/antd.css'; 
import { Button } from 'antd';
import QRCode from 'qrcode.react';


class MyReact extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            myReactValue :"" 
        };
        debugger;       
    } 
    componentWillUpdate(nextProps, nextState) {
        if (this.props !== nextProps) {
            let {data} = nextProps.state;
            if (data&&data.content&&data.content.body) {
                this.state.myReactValue = data.content.body;
            }
        }     
    }
    render() {
        return (
            <div>
            	this is MyReact : {this.state.myReactValue}
                <Link to={'/twoPage'}><div>go to test</div></Link>
                <Button type="danger">Danger</Button>
                <Button type="primary">Primary</Button>
                <QRCode value="http://www.baidu.com" />
            </div>
        )
    }
}
export default template({
    id: 'index',  
    component: MyReact,
    url: 'myReact.json'
});